<#include '/pages/taglib/core.ftl'>
<#include '/pages/taglib/common.ftl'>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
		<title><@i18n name="commons.productName"/></title>
    </head>
<body><div id="loginCtn">
	<script src="${base}/scripts/jquery-1.7.1.js" type="text/javascript"></script>
	<script src="${base}/scripts/espirit.js" type="text/javascript"></script>
	<script src="${base}/scripts/jtaglib.js" type="text/javascript"></script>
	<link href="${base}/styles/user.login.css" type="text/css" rel="Stylesheet"/>
	<script>
		$(document).ready(function() {
			var $input = $('input');
			$input.keypress(function(event) {
				if (event.which == 13) {
					login(this);
				}
			});
			$input.eq(0).focus();
			fixPlaceholderDefect($input);
		});	
	
		function submitResetPasswordForm() {
			var name = $('#username').val();
			if (name != '') {
				$.ajax({
					url: '${fn.link('/$/espirit/eap/sa/user.forgetPassword.html')}',
					data: {name: name},
					success: function(data, statusText) {
						var $data = $(data);
						if ($data.hasClass('error')) {
							showError($data.html());
						} else {
							showSuccess('密码重置请求已经发至您的注册邮箱,请检查您的邮件,进行重置密码');
						}
					}
				});
			}
		}
	</script>

	<div style="padding-top: 150px"></div>
	<div class="loginInputContainer" style="height: 150px;">
		<div class="retrievePasswordHeader">
      		取回用户密码
      	</div>
      	
		<input name="name" class="loginInput" id="username" placeholder="<@i18n name='model.espirit.eap.sa.user.name'/>"/>
		
		<div style="text-align: left">
			<button class="loginButton" type="button" onclick="submitResetPasswordForm();">取回密码</button>
			<a href="${fn.link('/$/espirit/eap/sa/user._login')}" id="resetPassword"><@i18n name="action.login"/></a>
		</div>
	</div>
</div></body>
</html>